print 'h(elp)\nWithout argument, print the list of available commands.\nWith a command name as argument, print help about that command\n"help pdb" pipes the full documentation file to the $PAGER\n"help exec" gives help on the ! command'
def help_where(self):
self.help_w()
def help_w(self):
print 'w(here)\nPrint a stack trace, with the most recent frame at the bottom.\nAn arrow indicates the "current frame", which determines the\ncontext of most commands. \'bt\' is an alias for this command.'
help_bt = help_w
def help_down(self):
self.help_d()
def help_d(self):
print 'd(own)\nMove the current frame one level down in the stack trace\n(to a newer frame).'
def help_up(self):
self.help_u()
def help_u(self):
print 'u(p)\nMove the current frame one level up in the stack trace\n(to an older frame).'
def help_break(self):
self.help_b()
def help_b(self):
print "b(reak) ([file:]lineno | function) [, condition]\nWith a line number argument, set a break there in the current\nfile. With a function name, set a break at first executable line\nof that function. Without argument, list all breaks. If a second\nargument is present, it is a string specifying an expression\nwhich must evaluate to true before the breakpoint is honored.\n\nThe line number may be prefixed with a filename and a colon,\nto specify a breakpoint in another file (probably one that\nhasn't been loaded yet). The file is searched for on sys.path;\nthe .py suffix may be omitted."
def help_clear(self):
self.help_cl()
def help_cl(self):
print 'cl(ear) filename:lineno'
print 'cl(ear) [bpnumber [bpnumber...]]\nWith a space separated list of breakpoint numbers, clear\nthose breakpoints. Without argument, clear all breaks (but\nfirst ask confirmation). With a filename:lineno argument,\nclear all breaks at that line in that file.\n\nNote that the argument is different from previous versions of\nthe debugger (in python distributions 1.5.1 and before) where\na linenumber was used instead of either filename:lineno or\nbreakpoint numbers.'
def help_tbreak(self):
print 'tbreak same arguments as break, but breakpoint is\nremoved when first hit.'
def help_enable(self):
print 'enable bpnumber [bpnumber ...]\nEnables the breakpoints given as a space separated list of\nbp numbers.'
def help_disable(self):
print 'disable bpnumber [bpnumber ...]\nDisables the breakpoints given as a space separated list of\nbp numbers.'
def help_ignore(self):
print 'ignore bpnumber count\nSets the ignore count for the given breakpoint number. A breakpoint\nbecomes active when the ignore count is zero. When non-zero, the\ncount is decremented each time the breakpoint is reached and the\nbreakpoint is not disabled and any associated condition evaluates\nto true.'
def help_condition(self):
print 'condition bpnumber str_condition\nstr_condition is a string specifying an expression which\nmust evaluate to true before the breakpoint is honored.\nIf str_condition is absent, any existing condition is removed;\ni.e., the breakpoint is made unconditional.'
def help_step(self):
self.help_s()
def help_s(self):
print 's(tep)\nExecute the current line, stop at the first possible occasion\n(either in a function that is called or in the current function).'
def help_next(self):
self.help_n()
def help_n(self):
print 'n(ext)\nContinue execution until the next line in the current function\nis reached or it returns.'
def help_return(self):
self.help_r()
def help_r(self):
print 'r(eturn)\nContinue execution until the current function returns.'
def help_continue(self):
self.help_c()
def help_cont(self):
self.help_c()
def help_c(self):
print 'c(ont(inue))\nContinue execution, only stop when a breakpoint is encountered.'
def help_jump(self):
self.help_j()
def help_j(self):
print 'j(ump) lineno\nSet the next line that will be executed.'
def help_debug(self):
print 'debug code\nEnter a recursive debugger that steps through the code argument\n(which is an arbitrary expression or statement to be executed\nin the current environment).'
def help_list(self):
self.help_l()
def help_l(self):
print 'l(ist) [first [,last]]\nList source code for the current file.\nWithout arguments, list 11 lines around the current line\nor continue the previous listing.\nWith one argument, list 11 lines starting at that line.\nWith two arguments, list the given range;\nif the second argument is less than the first, it is a count.'
def help_args(self):
self.help_a()
def help_a(self):
print 'a(rgs)\nPrint the arguments of the current function.'
def help_p(self):
print 'p expression\nPrint the value of the expression.'
def help_pp(self):
print 'pp expression\nPretty-print the value of the expression.'
def help_exec(self):
print "(!) statement\nExecute the (one-line) statement in the context of\nthe current stack frame.\nThe exclamation point can be omitted unless the first word\nof the statement resembles a debugger command.\nTo assign to a global variable you must always prefix the\ncommand with a 'global' command, e.g.:\n(Pdb) global list_options; list_options = ['-l']\n(Pdb)"
def help_quit(self):
self.help_q()
def help_q(self):
print 'q(uit) or exit - Quit from the debugger.\nThe program being executed is aborted.'
help_exit = help_q
def help_whatis(self):
print 'whatis arg\nPrints the type of the argument.'
def help_EOF(self):
print 'EOF\nHandles the receipt of EOF as a command.'
def help_alias(self):
print 'alias [name [command [parameter parameter ...] ]]\nCreates an alias called \'name\' the executes \'command\'. The command\nmust *not* be enclosed in quotes. Replaceable parameters are\nindicated by %1, %2, and so on, while %* is replaced by all the\nparameters. If no command is given, the current alias for name\nis shown. If no name is given, all aliases are listed.\n\nAliases may be nested and can contain anything that can be\nlegally typed at the pdb prompt. Note! You *can* override\ninternal pdb commands with aliases! Those internal commands\nare then hidden until the alias is removed. Aliasing is recursively\napplied to the first word of the command line; all other words\nin the line are left alone.\n\nSome useful aliases (especially when placed in the .pdbrc file) are:\n\n#Print instance variables (usage "pi classInst")\nalias pi for k in %1.__dict__.keys(): print "%1.",k,"=",%1.__dict__[k]\n\n#Print instance variables in self\nalias ps pi self\n'
def help_unalias(self):
print 'unalias name\nDeletes the specified alias.'
def help_pdb(self):
help()
def lookupmodule(self, filename):
'''Helper function for break/clear parsing -- may be overridden.
lookupmodule() translates (possibly incomplete) file or module name
into an absolute file name.
'''
if os.path.isabs(filename) and os.path.exists(filename):
return filename
f = os.path.join(sys.path[0], filename)
if os.path.exists(f) and self.canonic(f) == self.mainpyfile: